/** File: 	MainWindow.java
 *  Author:	Christopher Hayes
 *	Date:	Oct 15, 2009
 * 	Class:  CMSC 345
 * 
 */
package gui;

import java.awt.*;

import javax.swing.*;

/**
 * @author chris
 *
 */
public class MainWindow extends JFrame {
	
	public MainWindow () {
		this.setTitle("Cx3K Scheduler");
		this.setDefaultCloseOperation(EXIT_ON_CLOSE);
		this.setSize(1200, 900);
		GridBagLayout gbl = new GridBagLayout();
		this.setLayout(gbl);
		GridBagConstraints gbc = new GridBagConstraints();
		
		this.setJMenuBar(new MyMenuBar());
		SearchPane search = new SearchPane();
		gbc.gridx = 3;
		gbc.gridy = 0; 
		gbc.gridwidth = 1; 
		gbc.gridheight = 2; 
		gbc.weightx = 25; 
		gbc.weighty = 100; 
		gbc.fill = GridBagConstraints.BOTH; 
		gbc.anchor = GridBagConstraints.EAST; 
		gbl.setConstraints(search, gbc);
		this.add(search); 
		
		
		ProfilePane profile = new ProfilePane();
		gbc.gridx = 0;
		gbc.gridy = 0; 
		gbc.gridwidth = 1; 
		gbc.gridheight = 1; 
		gbc.weightx = 35; 
		gbc.weighty = 40; 
		gbc.fill = GridBagConstraints.BOTH; 
		gbc.anchor = GridBagConstraints.EAST; 
		gbl.setConstraints(profile, gbc);
		this.add(profile); 
		
		
		SchedulePane schedule = new SchedulePane();
		gbc.gridx = 0;
		gbc.gridy = 1; 
		gbc.gridwidth = 3; 
		gbc.gridheight = 1; 
		gbc.weightx = 75; 
		gbc.weighty = 60; 
		gbc.fill = GridBagConstraints.BOTH; 
		gbc.anchor = GridBagConstraints.EAST; 
		gbl.setConstraints(schedule, gbc);
		this.add(schedule); 
		
		ClassInfo classInfo = new ClassInfo();
		gbc.gridx = 2;
		gbc.gridy = 0; 
		gbc.gridwidth = 1; 
		gbc.gridheight = 1; 
		gbc.weightx = 25; 
		gbc.weighty = 40; 
		gbc.fill = GridBagConstraints.BOTH; 
		gbc.anchor = GridBagConstraints.EAST; 
		gbl.setConstraints(classInfo, gbc);
		this.add(classInfo); 
		
		
		Toolkit toolkit = this.getToolkit();
	    Dimension size = toolkit.getScreenSize();
	    this.setLocation(size.width/2 - getWidth()/2, size.height/2 - getHeight()/2);

		this.setVisible(true);
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		MainWindow m = new MainWindow();
	}

}
